]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
[MessageTray] show newly-added sources even if they don't post notifications
authorDan Winship <danw@gnome.org>
Thu, 9 Sep 2010 20:18:07 +0000 (16:18 -0400)
committerDan Winship <danw@gnome.org>
Thu, 23 Sep 2010 13:49:47 +0000 (09:49 -0400)
eg, when a trayicon is added, show the summary briefly

https://bugzilla.gnome.org/show_bug.cgi?id=608869

js/ui/messageTray.js

index d3be973443e3fbd9b2d07ec034ffd389c4cc5628..3546fa72472c99be7b087ffebd634387418932f1 100644 (file)
@@ -4,6 +4,7 @@ const Clutter = imports.gi.Clutter;
 const Gtk = imports.gi.Gtk;
 const Lang = imports.lang;
 const Mainloop = imports.mainloop;
+const Meta = imports.gi.Meta;
 const Pango = imports.gi.Pango;
 const Shell = imports.gi.Shell;
 const Signals = imports.signals;
@@ -983,6 +984,12 @@ MessageTray.prototype = {
             function () {
                 this.removeSource(source);
             }));
+
+        // We need to display the newly-added summary item, but if the
+        // caller is about to post a notification, we want to show that
+        // *first* and not show the summary item until after it hides.
+        // So postpone calling _updateState() a tiny bit.
+        Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this, function() { this._updateState(); return false; }));
     },
 
     removeSource: function(source) {